package com.xiaolun.bean

class Customer {
  var id: Int = _
  var age: Int = _
  var name: String = _
  var gender: Char = _ //性别，男/女
  var phone: String = _
  var email: String = _

  //先设计一个辅助构造器（主构造器，每个辅助构造器都要调用，设计时比较慎重，先不写）
  def this(id: Int, age: Int, name: String, gender: Char, phone: String, email: String) {
    this()
    this.id = id
    this.age = age
    this.name = name
    this.gender = gender
    this.phone = phone
    this.email = email
  }

  //在添加用户的时候，不能将id输入，应该编写一个id增加的算法
  def this(age: Int, name: String, gender: Char, phone: String, email: String) {
    this()
    this.age = age
    this.name = name
    this.gender = gender
    this.phone = phone
    this.email = email
  }

  def getInfo(): String = {
    return this.id + "\t\t" + this.name + "\t\t" + this.gender + "\t\t" + this.age + "\t\t" + this.phone + "\t\t" + this.email
  }
}
